﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace PSE.Framework.Common.Validation
{
    [DataContract(Namespace = "http://www.bvmf.com.br/PSE.Framework.Common.Validation", Name = "ValidationError")]
    public class ValidationError
    {
        public ValidationError()
        {
        }

        public ValidationError(int errorNumber)
        {
            _errorNumber = errorNumber;
        }

        public ValidationError(int errorNumber, string errorMessage)
            : this(errorNumber)
        {
            _errorMessage = errorMessage;
        }
     
        private int _errorNumber = 0;
        /// <summary>
        /// Código do erro
        /// </summary>
        [DataMember(IsRequired = true, Name = "ErrorNumber", Order = 1)]
        public int ErrorNumber
        {
            get { return _errorNumber; }
            set { _errorNumber = value; }
        }

        private string _errorMessage = string.Empty;
        /// <summary>
        /// Mensagem de erro
        /// </summary>
        [DataMember(IsRequired = true, Name = "ErrorMessage", Order = 2)]
        public string ErrorMessage
        {
            get { return _errorMessage; }
            set { _errorMessage = value; }
        }

   }
}
